const express = require('express');
const foodCtrl = require('../../app/controllers/food.server.controller.js');

module.exports = (app) => {
    const router = express.Router();

    router.route('/addFood')
    .post(foodCtrl.addFoodItem);

    router.route('/deleteFoodByFoodId/:foodId')
    .get(foodCtrl.delFoodItemByFoodId);

    router.route('/getAllFoodByMerchantId/:merchantId')
    .get(foodCtrl.getAllFoodItemsByMerchantId);

    router.route('/getAllFood')
        .get(foodCtrl.getAllFoodItems);

    router.route('/getFoodByFoodId/:foodId')
        .get(foodCtrl.getFoodItemByFoodItemId);

    router.route('/getFoodByFoodType/:foodType/:merchantId')
        .get(foodCtrl.getAllFoodItemsByFoodTypeWithMerchantId);

    router.route('/modifyFoodByFoodId')
    .post(foodCtrl.modifyFoodItemByFoodItemId);

    app.use('/food', router);
};